package com.ticket.sass.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ticket.sass.admin.mapper.BannerPositionMapper;
import com.ticket.sass.admin.service.BaseService;
import com.ticket.sass.common.entity.tenant.BannerPositionEntity;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ywb
 * @since 2024-04-30
 */
@Service
public class BannerPositionServiceImpl extends ServiceImpl<BannerPositionMapper, BannerPositionEntity> implements BaseService<BannerPositionEntity> {
    public List<Short> getPositionArrayByBannerId(Long noticeId) {
        return this.baseMapper.getPositionArrayByBannerId(noticeId);
    }
    
    public List<BannerPositionEntity> getPositionsByBannerIds(List<Long> bannerIds) {
        if (bannerIds.size() == 0){
            return new ArrayList<>();
        }
        return this.list(new QueryWrapper<BannerPositionEntity>().in("banner_id", bannerIds));
    }
}
